define(
	[
		'require',
		'../moment',
		'apm/daterangepicker',
		'broada/base/text!./template.hbs'
	],
	function (require) {
		"use strict";
		var tpl = require('broada/base/text!./template.hbs');
		var ServiceServerDateView = Ember.Component.extend({
			layout: Ember.HTMLBars.compile(tpl),
			didInsertElement: function(){
		        this.updateConfig();
			},
			updateConfig:function() {
	          var options = {};
	          var ctrl = this.get("controller");
			  var $viewRoot = this.$().find('input');
	          $viewRoot.daterangepicker(options, function(start, end, label) { console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') ); });
	          
	        }
			
			
		});

		return ServiceServerDateView;
	}
);